package com.st.shopadmin.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.st.shopadmin.common.ServerResponse;
import com.st.shopadmin.dao.MoneyLogMapper;
import com.st.shopadmin.pojo.MoneyLog;
import com.st.shopadmin.service.RechargeMoneyLogService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RechargeMoneyLogServiceImpl implements RechargeMoneyLogService {
    @Autowired
    private MoneyLogMapper moneyLogMapper;

    @Override
    public ServerResponse<List> list(int pageNum, int pageSize) {
        List<MoneyLog> moneyLogList = moneyLogMapper.selectList();
        return  ServerResponse.createBySuccess(moneyLogList);
    }

    @Override
    public ServerResponse<PageInfo> page(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<MoneyLog> productList = moneyLogMapper.selectList();
        PageInfo pageResult = new PageInfo(productList);
        return  ServerResponse.createBySuccess(pageResult);
    }
}
